#pragma once
#ifndef NEW_QUEUE_H
#define NEW_QUEUE_H

#include <string.h>
#include <stdlib.h>
#include <stdio.h>


#include "consts.h"
#include "user_socket_link.h"

typedef struct user
{
    char mess[MAX_SIZE];
    char user_name[MAX_SIZE];
    char ip_addr[16];
    int DBid;
}user_t;

typedef struct queue
{
    user_t queue[MAX_SIZE];
    int len;
}queue_t;

void init_queue(queue_t *q);

void insert_queue(queue_t *q, char *mess, char *user_name, FILE *Q_FILE);

int is_empty_queue(const queue_t *q);

void remove_queue(queue_t *q, int fd);

int is_in_queue(queue_t *q, int fd);

#endif
